package Asgmt1.element;

import java.util.Arrays;
import java.util.Random;

public class Dice {
    private int[] dice;
    private int numDice;

    public Dice() {
        this.numDice = 5;
        dice = new int[numDice];
    }

    public int getRoll() {
        Random r = new Random();
        return r.nextInt(6) + 1;
    }

    public int[] rollDice() {
        for (int i = 0; i < numDice; i++) {
            dice[i] = this.getRoll();
        }
        return dice;
    }

    public int[] getDice() {
        return dice;
    }

    @Override
    public String toString() {
        return "dice=" + Arrays.toString(dice);
    }
}
